(function($) {
	debugger;
	//扩展Array的原型对象，加入indexOf方法;解决jquery.easyui.min.js1.3.3版本combobox多选取消问题
	if(!Array.prototype.indexOf){
		Array.prototype.indexOf = function(target){
		        for(var i=0,l=this.length;i<l;i++){  
		            if(this[i] === target) return i;  
				}  
			return -1;  
		};  
	}
	$.extend({
				lora : {
					common : {
						/*公共的报表导出方法*/
						commonExportReport : function(datagrid, fileName) {
							var url = '/common/report/commonExportReport.html';
							var columns = $("#" + datagrid).datagrid('options').columns;
                            var rows;
							try {
                                rows = $("#" + datagrid).treegrid('getData');
							} catch(e) {
                                rows = $("#" + datagrid).datagrid('getData').rows;
							}
							var footerRows = $("#" + datagrid).datagrid('getFooterRows');
							var queryParams = {};
							queryParams['exportTitles'] = JSON.stringify(columns);
							queryParams['exportRows'] = JSON.stringify(rows);
							queryParams['totalCol'] = $("#" + datagrid).datagrid("getColumnFields").length;
							queryParams['totalRow'] = $("#" + datagrid).datagrid("options").columns.length;
							if(!footerRows) 
								footerRows = [];
							queryParams['footerRows'] = JSON.stringify(footerRows);
							queryParams['exportFileName'] = fileName;
							$.acooly.framework.createAndSubmitForm(url, queryParams);
						}
					}
				}
			});
})(jQuery);
